package _99BeiWangLu;

/**
 * @Originator: 对象状态管理类
 * @author: ZBoHang
 * @time: 2021/9/17 14:53
 */
public class Originator {
    private String state;

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Memento saveStateToMemento() {
        return new Memento(state);
    }

    public void getStateFromMemento(Memento memento) {
        state = memento.getState();
    }
}
